package com.max.xihu.collection;

import com.max.xihu.lambda.Human;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Max
 * @Date: 2020-04-13 09:41
 * @Description:
 */
public class ArrayListDemo {

    public static void main(String[] args) {

        List<Human> humans = listHuman().subList(0, 10);
        System.out.println(humans.size());

    }

    public static List<Human> listHuman(){


        List<Human> list = new ArrayList<>();
        Human human = new Human();
        human.setId(1);
        human.setName("aaa");
        list.add(human);

        Human human1 = new Human();
        human1.setId(3);
        human1.setName("ccc");
        list.add(human1);

        Human human2 = new Human();
        human2.setId(3);
        human2.setName("ccc");
        list.add(human2);

        Human human3 = new Human();
        human3.setId(2);
        human3.setName("bbb");
        list.add(human3);
        return list;

    }



}
